'File Dialog box manager. Uses Windows system calls to increase
'speed and give a dialog box that dosen't have "visual basic"
'stamped all over it!
'
DefInt A-Z
Declare Function DlgDirList Lib "User" (ByVal hDlg As Integer, ByVal lpPathSpec As String, ByVal nIDListBox As Integer, ByVal nIDStaticPath As Integer, ByVal wFiletype As Integer) As Integer
Const TRUE = -1
Const FALSE = 0
'--- these constants are used by GetFileBox form
Const File_Box = &H7
Const Dir_Box = &H9
Const DrivesAndDir = &H10 Or &H4000 Or &H8000
Const FilesOnly = &H1
Dim File_Mask As String
Sub ChangeTo (FileSpec$)
On Error GoTo ErrorHandler
OldPath$ = CurDir$("")
If InStr(FileSpec$, "[-") Then 'drive
Drive$ = Mid$(FileSpec$, 3, Len(FileSpec$) - 3)
ChDrive Drive$
UpDateForm
ElseIf InStr(FileSpec$, "[") Then 'dir
SDir$ = Mid$(FileSpec$, 2, Len(FileSpec$) - 2)
ChDir SDir$
UpDateForm
Else
End If
Exit Sub
ErrorHandler:
ChDrive OldPath$
ChDir OldPath$
Exit Sub
End Sub
Sub Command1_Click ()
GetFileBox.Hide
GetFileBox.Path = CurDir$
End Sub
Sub Command2_Click ()
GetFileBox.FileSpec.Text = ""
GetFileBox.Hide
End Sub
Sub Dirs_DblClick ()
'
'
'
FileSpec.Text = File_Mask
NewFileSpec$ = Dirs.Text
ChangeTo NewFileSpec$
End Sub
Sub Dirs_KeyDown (KeyCode As Integer, Shift As Integer)
FileSpec.Text = ProcessDir()
End Sub
Sub Dirs_KeyPress (KeyAscii As Integer)
If KeyAscii = 13 Then
FileSpec.Text = File_Mask
NewFileSpec$ = Dirs.Text
ChangeTo NewFileSpec$
End If
End Sub
Sub Dirs_KeyUp (KeyCode As Integer, Shift As Integer)
FileSpec.Text = ProcessDir()
End Sub
Sub Dirs_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
FileSpec.Text = ProcessDir()
End Sub
Sub Files_DblClick ()
'
'
'
GetFileBox.Hide
End Sub
Sub Files_KeyDown (KeyCode As Integer, Shift As Integer)
FileSpec.Text = Files.Text
End Sub
Sub Files_KeyPress (KeyAscii As Integer)
If KeyAscii = 13 Then GetFileBox.Hide
End Sub
Sub Files_KeyUp (KeyCode As Integer, Shift As Integer)
FileSpec.Text = Files.Text
End Sub
Sub Files_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)